﻿using UnityEngine;
using System.Collections;

public class TapToStartScript : MonoBehaviour {

	// Use this for initialization
	void Start () {
		GetComponent<Renderer>().enabled = true;
	}
	
	// Update is called once per frame
	void Update () {
		//on click/touch, disable the Touch To Play Screen
		if((((Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)) || Input.GetKeyDown(KeyCode.Space)) && GetComponent<Renderer>().enabled == true)
		{
			//GetComponent<Renderer>().enabled = false;
			this.gameObject.SetActive(false);
		}
		//if the character is movine no need to show the Tap To Play screen
		if(CharacterController.canMove == true)
		{
			this.gameObject.SetActive(false);
		}

	}

	void OnMouseDown()
	{
		Time.timeScale = 1;
		CharacterController.canMove = true;
		//GetComponent<Renderer>().enabled = false;
		this.gameObject.SetActive(false);
	}
}
